// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/request'

// 首页数据概览
export function viewModelApi() {
    return request({
        url: '/statistics/getCountAll',
        method: 'GET',
    })
}

export function promotionApi() {
    return request({
        url: '/homepage/promotion',
        method: 'GET',
    })
}

export function turnoverTrendApi(type) {
    return request({
        url: '/homepage/turnoverTrend',
        method: 'GET',
        params:{type}
    })
}

export function businessTrendsApi(type) {
    return request({
        url: '/homepage/businessTrendsApi',
        method: 'GET',
        params:{type}
    })
}

export function voucherIncomeApi() {
    return request({
        url: '/homepage/voucherIncome',
        method: 'GET',
    })
}
export function userVoucherConsumption() {
    return request({
        url: '/homepage/voucherConsumption',
        method: 'GET',
    })
}
export function getTopOfMerchant() {
    return request({
        url: '/homepage/top10',
        method: 'GET',
    })
}

export function getVoucherList() {
    return request({
        url: '/voucherRecord/voucherRanking',
        method: 'GET',
    })
}

export function getIntegralList() {
    return request({
        url: '/voucherRecord/integralRanking',
        method: 'GET',
    })
}

export function financialStatement(data){
    return request({
        url:'/homepage/financialStatements',
        method:'POST',
        data
    })
}
export function queryStatusPoints(){
    return request({
        url:'/statistics/queryStatusPoints',
        method:'GET',
    })
}
export function totalUsageCoupons(parmar){
    return request({
        url:'/statistics/totalUsageCoupons',
        method:'GET',
        parmar
    })
}
/**
 * 财务报表
 *
 * @param request 请求
 * @param params  params
 * @return {@link Result }
 */
export function consumerData(data){
    return request({
        url:'/homepage/consumerData',
        method:'POST',
        data
    })
}
/**
 * 财务报表列表
 *
 * @param request 请求
 * @param params  params
 * @return {@link Result }
 */
export function consumerDataList(data){
    return request({
        url:'/homepage/consumerDataList',
        method:'POST',
        data
    })
}
/**
 * 转账数据
 *
 * @param request 请求
 * @param params  params
 * @return {@link Result }
 */
export function transferData(data){
    return request({
        url:'/homepage/transferData',
        method:'POST',
        data
    })
}

/**
 * 转账数据列表
 *
 * @param request 请求
 * @param params  params
 * @return {@link Result }
 */
export function transferDataList(data){
    return request({
        url:'/homepage/transferDataList',
        method:'POST',
        data
    })
}